package com.yyf.controller;

import com.yyf.product.OrderProducer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class OrderController {
    @Resource
    private OrderProducer orderProducer;

    @GetMapping("/order/{id}")
    public String createOrder(@PathVariable String id) {
        orderProducer.sendOrderMessage(id);
        return "订单创建成功:" + id;
    }
}
